<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>Document</title>
		<style>
			*{
				padding: 0;
				margin: 0;
			}
			h1{
				font-size: 60px;
			}
			#demo{
				width: 980px;
				height: 300px;
				background-color: skyblue;
			}
		</style>
	</head>
	<body>
		<div id="demo"></div>
		<h1>当前设备布局视口宽度为：</h1>
		<script type="text/javascript" >
			const h1 = document.querySelector('h1')
			h1.innerHTML += document.documentElement.clientWidth
			console.log('该设备的布局视口宽度为：',document.documentElement.clientWidth)
		</script>
	</body>
</html>